﻿using System.Collections.Generic;

namespace com.binance.client.model.enums
{
	public sealed class DealRole
	{

	  /// <summary>
	  /// TAKER,MAKER
	  /// </summary>

	  public static readonly DealRole TAKER = new DealRole("TAKER", InnerEnum.TAKER, "taker");
	  public static readonly DealRole MAKER = new DealRole("MAKER", InnerEnum.MAKER, "maker");

	  private static readonly IList<DealRole> valueList = new List<DealRole>();

	  static DealRole()
	  {
		  valueList.Add(TAKER);
		  valueList.Add(MAKER);
	  }

	  public enum InnerEnum
	  {
		  TAKER,
		  MAKER
	  }

	  public readonly InnerEnum innerEnumValue;
	  private readonly string nameValue;
	  private readonly int ordinalValue;
	  private static int nextOrdinal = 0;

	  private readonly string role;

	  internal DealRole(string name, InnerEnum innerEnum, string role)
	  {
		this.role = role;

		  nameValue = name;
		  ordinalValue = nextOrdinal++;
		  innerEnumValue = innerEnum;
	  }

	  public string Role
	  {
		  get
		  {
			return role;
		  }
	  }

	  public static DealRole find(string role)
	  {
		foreach (DealRole fr in DealRole.values())
		{
		  if (fr.Role.Equals(role))
		  {
			return fr;
		  }
		}
		return null;
	  }

		public static IList<DealRole> values()
		{
			return valueList;
		}

		public int ordinal()
		{
			return ordinalValue;
		}

		public override string ToString()
		{
			return nameValue;
		}

		public static DealRole valueOf(string name)
		{
			foreach (DealRole enumInstance in DealRole.valueList)
			{
				if (enumInstance.nameValue == name)
				{
					return enumInstance;
				}
			}
			throw new System.ArgumentException(name);
		}
	}

}